import * as type from './mutation-types'
import * as API from './api'
import { ajax } from '@/utils/fetch'
// Appsflyer 历史补发中台用户列表  
export const getSupplementHistoryList = ({ commit }, data) => {
    commit(type.SUPPLEMENTHISTORYLIST_REQUEST, data);
    return ajax.get(
        API.getSupplementHistoryList,
        { commit },
        data,
        type.SUPPLEMENTHISTORYLIST_RECEIVE
    );
};
// Appsflyer 校验补发历史任务查询  
export const getVerifyTaskHistoryList = ({ commit }, data) => {
    commit(type.VERIFYTASKHISTORYLIST_REQUEST, data);
    return ajax.get(
        API.getVerifyTaskHistoryList,
        { commit },
        data,
        type.VERIFYTASKHISTORYLIST_RECEIVE
    );
};
// Appsflyer 订单事件真伪判断  
export const checkFakeOrder = ({ commit }, data) => {
    commit(type.CHECKFAKEORDER_REQUEST, data);
    return ajax.upload(
        API.checkFakeOrder,
        { commit },
        data,
        type.CHECKFAKEORDER_RECEIVE
    );
};
// 校验 Appsflyer 漏报的设备信息  
export const verifyMissingDevice = ({ commit }, data) => {
    commit(type.VERIFYMISSINGDEVICE_REQUEST, data);
    return ajax.upload(
        API.verifyMissingDevice,
        { commit },
        data,
        type.VERIFYMISSINGDEVICE_RECEIVE
    );
};
// 前端定时轮询查询校验进度  
export const getCheckBatchVerifyProcess = ({ commit }, data) => {
    commit(type.CHECKBATCHVERIFYPROCESS_REQUEST, data);
    return ajax.get(
        API.getCheckBatchVerifyProcess,
        { commit },
        data,
        type.CHECKBATCHVERIFYPROCESS_RECEIVE
    );
};
// 查询Appsflyer 漏报校验结果  
export const getVerifyResult = ({ commit }, data) => {
    commit(type.VERIFYRESULT_REQUEST, data);
    return ajax.get(
        API.getVerifyResult,
        { commit },
        data,
        type.VERIFYRESULT_RECEIVE
    );
};
// Appsflyer 校验补充  
export const getSupplementMissingData = ({ commit }, data) => {
    commit(type.SUPPLEMENTMISSINGDATA_REQUEST, data);
    return ajax.post(
        API.getSupplementMissingData,
        { commit },
        data,
        type.SUPPLEMENTMISSINGDATA_RECEIVE
    );
};
// 删除历史补发  
export const deleteSupplementHistory = ({ commit }, data) => {
    commit(type.DELETESUPPLEMENTHISTORY_REQUEST, data);
    return ajax.get(
        API.deleteSupplementHistory,
        { commit },
        data,
        type.DELETESUPPLEMENTHISTORY_RECEIVE
    );
};
// Appsflyer 查询中台账号历史三个月的登录行为  
export const getLoginInfoList = ({ commit }, data) => {
    commit(type.LOGININFOLIST_REQUEST, data);
    return ajax.get(
        API.getLoginInfoList,
        { commit },
        data,
        type.LOGININFOLIST_RECEIVE
    );
};